import { createRouter, createWebHistory } from 'vue-router'

const routes = [
	{	//默认显示home页面
		path: '/',
		redirect:"/home" //重定向到/home页面
	},
	{
		path: '/home',
		name: "Home",
		component: ()=>import('../views/Home.vue'),
		children:[//子路由
			{
				path:'',
				redirect:'/home/news'
			},
			{
				path:"news",
				name:"News",
				component:()=>import('../views/News.vue')
			},
			{
				path:"msg",
				name:"Message",
				component:()=>import('../views/Message.vue')
			}
		]
	},
	{
		path: '/about',
		name: 'About',
		component: ()=>import('../views/About.vue')
	},
	
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
